<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // startWith 匹配域名啥得
        // endWith 匹配文件 .jpg .png
        let numebr =[1,2,3]
        let newNumber = [...numebr,{
            filter:"123"
        }] 
        console.log(newNumber)
        if(location.origin.startsWith("http://")){
            console.log("http协议")
        }else if(location.origin.startsWith("https://")){
            console.log("https协议")
        }else{
            console.log('不知道了')
        }
        let pngsStr = '01.png';
        if(pngsStr.endsWith(".png")){
            console.log('是png图片啊')
        }


        // 模板字符串
        let str = '呵呵'
        console.log(`${str}`)

    </script>
</body>
</html>